import java.util.Arrays;

public class Test {
    //奇数位于偶数之前，调整数组顺序使得奇数位于偶数之前。
    // 调整之后，不关系大小顺序
    public static void func(int[]array){
        int i =0;
        int j = array.length-1;
        while (i<j){
            while (i<j && array[i]%2!=0){
                i++;
            }
            while (i<j && array[j]%2==0){
                j--;
            }
            int tmp = array[i];
            array[i]=array[j];
            array[j]= tmp;
        }
    }
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5,6};
        func(array);
        System.out.println(Arrays.toString(array));
    }
    public static void transform(int[] array){
        for (int i = 0; i <array.length; i++) {
            array[i]=array[i]*2;
        }
    }
    public static void main8(String[] args) {
        int[] array = {1,2,3,4,5};
        System.out.println(Arrays.toString(array));
        transform(array);
        System.out.println(Arrays.toString(array));


    }
    public static void main7(String[] args) {
        int[] array = new int[10];
        Arrays.fill(array,2,5,-1); // [2,6)
        System.out.println(Arrays.toString(array));
    }
    public static void main6(String[] args) {
        int[] array = {1,2,3};
        int[] array1 = {1,2,3};
        Boolean ret = Arrays.equals(array, array1);
        System.out.println(ret);
    }
    public static void main5(String[] args) {
        int[][] array = new int[2][];
        array[0]= new int[]{1,2,3,4,5};
        array[1]=new int[3];
        System.out.println(Arrays.deepToString(array));

    }
    public static void main4(String[] args) {
        int[][] array = {{1,2,3},{4,5,6}};
        System.out.println(Arrays.deepToString(array));
    }
    public static void main2(String[] args) {
        int[][] array = {{1,2,3},{4,5,6}};

        System.out.println(array.length);
        System.out.println(array[0]);
        System.out.println(array[0].length);
    }
    public static void main3(String[] args) {

        int[][] array = {{1,2,3},{4,5,6}};

        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
    }
    public static void main1(String[] args) {
        int[] [] array = new int[][]{{1,2,3,},{4,5,6}};

        int[] [] array2 ={{1,2,3,},{4,5,6,}};

        int[] [] array1 = new int[2][3]; //0

    }
}
